<?php
/**
 * Created by PhpStorm.
 * User: lenovo
 * Date: 2021/3/22
 * Time: 9:52
 */

namespace api\modules\v2\controllers;
use api\controllers\OnAuthController;
use common\models\Membercate\Membercate;

class MembercateController extends OnAuthController
{
    public $modelClass =Membercate ::class;

    protected $authOptional = ['index'];

    /**
     * @return string|\yii\data\ActiveDataProvider
     */
    public function actionIndex()
    {
        $membercate = Membercate::find()->select('id,name,url')->all();
        if($membercate){
            return $membercate;
        }else{
            return "请求失败";
        }
    }
}